import { request } from '@umijs/max';

export interface StateType {
  status?: 'ok' | 'error';
  currentAuthority?: 'user' | 'guest' | 'admin';
}

export interface UserRegisterParams {
  // mail: string;
  // password: string;
  // confirm: string;
  // mobile: string;
  // captcha: string;
  // prefix: string;

  headImg?: string;
  phone: string;
  pwd: string;
  confirm: string;
  mail: string;
  username: string;
  code: string;
}

export async function fakeRegister(params: UserRegisterParams) {
  return request('/account-server/api/account/v1/register', {
    method: 'POST',
    data: params,
  });
}
export async function sendCode(params: any) {
  return request('/account-server/api/notify/v1/send_code', {
    method: 'POST',
    data: params,
  });
}
